const Path = require('path');

module.exports = function ({ content, path, option, fileInfo }) {
    const postcss = require(Path.resolve(option.nmodulePath, './postcss'));
    let ops = Reflect.ownKeys(option.compiler.postcss).map(a => {
        let t = Path.resolve(option.nmodulePath, `./${a}`);
        return require(t)(option.compiler.postcss[a]);
    });
    return postcss(ops).process(content, {
        from: undefined
    }).then(result => {
        return result.css;
    });
};